package com.vijos;

// 谁拿了最多奖学金
public class P1_2_1001 {
//    4
//    YaoLin 87 82 Y N 0
//    ChenRuiyi 88 78 N Y 1
//    LiXin 92 88 N N 0
//    ZhangQin 83 87 Y N 1

    public static Object[] test(Student[] students) {
        String name = "";
        int max = -1;
        int total = 0;
        for (int i = 0; i < students.length; i++) {
            Student student = students[i];
            int amount = 0;
            // 8000
            if (student.getScore() > 80 && student.getLw() >= 1) {
                amount += 8000;
            }
            // 4000
            if (student.getScore() > 85 && student.getBjpy() > 80) {
                amount += 4000;
            }
            // 2000
            if (student.getScore() > 90) {
                amount += 2000;
            }
            // 1000
            if (student.getScore() > 85 && student.isXb()) {
                amount += 1000;
            }
            // 850
            if (student.getScore() > 80 && student.isGb()) {
                amount += 850;
            }
            total += amount;
            if (amount > max) {
                max = amount;
                name = student.getName();
            }
        }
        return new Object[] {name, max, total};
    }

    public static void main(String[] args) {
        Student[] students = new Student[] {
            new Student().setName("abc").setScore(99).setBjpy(99).setXb(true).setGb(true).setLw(3)
        };
        Object[] result = test(students);
        System.out.println(result[0] + " " + result[1] +  " " + result[2]);
    }

    static class Student {
        private int score;
        private String name;
        private int qm;
        private int bjpy;
        private boolean gb;
        private boolean xb;
        private int lw;

        public String getName() {
            return name;
        }

        public Student setName(String name) {
            this.name = name;
            return this;
        }

        public int getLw() {
            return lw;
        }

        public Student setLw(int lw) {
            this.lw = lw;
            return this;
        }

        public int getScore() {
            return score;
        }

        public Student setScore(int score) {
            this.score = score;
            return this;
        }

        public int getQm() {
            return qm;
        }

        public Student setQm(int qm) {
            this.qm = qm;
            return this;
        }

        public int getBjpy() {
            return bjpy;
        }

        public Student setBjpy(int bjpy) {
            this.bjpy = bjpy;
            return this;
        }

        public boolean isGb() {
            return gb;
        }

        public Student setGb(boolean gb) {
            this.gb = gb;
            return this;
        }

        public boolean isXb() {
            return xb;
        }

        public Student setXb(boolean xb) {
            this.xb = xb;
            return this;
        }
    }
}
